/*
#include<iostream>
using namespace std;

bool check(int x) {
	for (int i = 1; i < x; ++i) {
		int sum = 0;
		for (int j = i; j < x; ++j) {
			sum += j;
			if (sum == x)
				return true;
		}
	}
	return false;
}


int main() {

	for (int i = 3; i <= 400; ++i) {
		if (check(i)) {
			continue;

		}
		cout << i << endl;
	}
	return 0;
}
*/
/*
#include <iostream>
using namespace std;
const int N = 1e6 + 10;
typedef long long ll;
ll a[N];
int res;
int n;

bool is_power_of_two(ll n) {

    return n > 0 and (n & (n - 1)) == 0;
}


int main()
{
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        if (is_power_of_two(a[i])) {
            res++;
        }
    }

    cout << res;
    return 0;
}

*/

/*
#include <iostream>
using namespace std;
typedef long long ll;
const ll N = 1e5;
ll ret;
ll L, R;
ll a[N];
ll b[N];
ll c[N];
ll flag;
int main()
{
	cin >> L >> R;
	for (ll i = 1; i <= R-L; ++i) {
		a[i] = 1ll*i * i;
		if (a[i] - a[i - 1] > R) {
			flag = i-1;
			break;
		}
			
		b[i] = a[i] - a[i-1];
	}

	for (ll i = 1; (i <= R - L) && (i+1 <= R - L); ++i) {
		a[i] = 1ll * i * i;
		
		if (a[i + 1] - a[i - 1] > R)
			break;
		c[i] = a[i + 1] - a[i - 1];
	}

	for (ll j = 1; j <= flag; ++j) {
		ret++;
		if (c[j] == 0)
			continue;
		ret++;
	}
	cout << ret << endl;
    return 0;
}
*/
/*
#include <iostream>
using namespace std;

// 计算区间 [L, R] 中奇数的个数
int count_odd(int L, int R) {
	return (R+1)/2 - L/2;
}

// 计算区间 [L, R] 中4的倍数的个数
int count_multiple_of_four(int L, int R) {
	return (R / 4) - ((L - 1) / 4);
}

// 计算区间 [L, R] 中奇数或4的倍数的个数
int count_odd_or_multiple_of_four(int L, int R) {
	return count_odd(L, R) + count_multiple_of_four(L, R);
}

int main() {
	int L, R;
	cout << "请输入区间 [L, R] 的值：" << endl;
	cin >> L >> R;

	int result = count_odd_or_multiple_of_four(L, R);
	cout << "区间 [" << L << ", " << R << "] 中奇数或4的倍数的个数为：" << result << endl;

	return 0;
}
*/

#include <iostream>
using namespace std;
typedef long long ll;

const int N = 1e9;

int main()
{
	ll res = 0;
	ll fac = 1;
	for (ll i = 1; i <= 50; ++i) {
		fac = (i *fac)%N;
		res = (fac +res)%N;
		cout << res << endl;
	}

	return 0;
}